<template>
  <div class="header">
    <div class="title">通用管理系统</div>
    <div class="username" :if="username != ''">{{ username }}</div>
  </div>
</template>

<script>
import { getItem } from "@/utils/localStorageOpe";
export default {
  data() {
    return {
      username: "",
    };
  },
  methods: {
    init() {
      this.username = getItem("username");
    },
  },
  created() {
    this.init();
  },
};
</script>

<style lang="scss" scoped>
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 8%;
  background-color: #1e74ba;
  padding: 0 30px 0 50px;
  color: #fff;
  .title {
    font-size: 30px;
  }
}
</style>
